var left_main = document.querySelector(".left-main");
var fixed_top = document.querySelector(".fixed-top");
var hide = document.querySelector(".hide");
var item2 = document.querySelector(".item2");

window.onscroll = function(){
    if(document.body.offsetWidth > '600' && (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100)){
        left_main.style.position = "fixed";
        left_main.style.top = "120px";
        fixed_top.style.position = "fixed";
    }else {
        left_main.style.position = "relative";
        left_main.style.top = "0";
        fixed_top.style.position = "relative";
    }
    if(document.body.scrollTop > 1000 || document.documentElement.scrollTop > 1000){
        hide.classList = "item1";
    }else {
        hide.classList = "item1 hide";
    }
};
item2.addEventListener('click',function (){
    window.scrollTo(0,0);
});